TOOLS:W THE SOURCE FOR MICROSOFT WINDOWS SDK APPLICATION DEVELOPMENT TOOLS -------------------------------- Thankyou for your interest in TOOLS:W! This readme file contains a short overview of TOOLS:W along with a technical description of how each tool works. To install the TDEMO demostration program: 1. Make sure that you already have Microsoft Windows Installed. 2. Make sure that you have at least BUFFERS=20 and FILES=20 in your "CONFIG.SYS" file. Also make sure that you do not have any TSR software installed. Some TSR software has memory and interrupt conflicts with Microsoft Windows. 3. Copy all TDEMO files to a subdirectory of your choice. 4. Make sure that you have a path to the Windows directory. This can be accomplished by typing "PATH C:\WINDOWS". 5. Type "TDEMOWIN" to start the TDEMO program. TDEMOWIN is a batch file that will load Btrieve prior to starting Windows and loading TDEMO. For more information call: The Software Factory PO Box 2639 Gainesville, Fl 32602 (904) 376-8370 LICENSES AND TRADEMARKS. TOOLS:W is a trademark of Kent Gryzich. Microsoft Windows is a trademark of Microsoft Corporation. Novell and Btrieve are trademarks of Novell, Inc. TOOLS:W OVERVIEW TOOLS:W was developed to provide fast development of Microsoft Windows applications using the Windows SDK. TOOLS:W adds to the powerful Windows SDK development environment with dialog box input validation, multi-user database interface, graphical display of database records, report writing, help, start-up, DDE and more. TOOLS:W can save you up to 95% of the time it normally takes to develop high quality Windows Applications. These tools are a library of generically written functions (or objects) that eliminates most of the complex coding of standard Windows application features. TOOLS:W is not another development language or prototyping system! You will find the TOOLS:W approach invaluable for completing your Windows Application. In order to use TOOLS:W you still must use the Microsoft Windows Software Development Kit and program using Microsoft 'C'. You must also purchase the Btrieve record management system from NOVELL. TOOLS:W allows professional programmers to quickly develop high quality, user oriented Microsoft Windows based applications. The tools are listed below. FILE INITIALIZATION TOOL DIALOG TOOL FILE MAINTENANCE TOOL FILE DISPLAY TOOL REPORT TOOL HELP TOOL START-UP TOOL DDE TOOL VERSION CONVERSION TOOL You will find these tools easy to use! We kept things simple and easy to maintain. Each of these tools provides a framework to perform the important features that you find in most computer applications. TOOLS:W is primarily intended for disk based, transaction oriented applications, such as accounting systems and other data based applications developed for resale. TOOLS:W is still valuable for developing heavily graphic oriented applications Not only is TOOLS:W a fast way to develop Windows applications, but TOOLS:W is also an inexpensive and safe development environment. Neither TOOLS:W nor Btrieve require royalties upon distribution of your finished application. And since TOOLS:W source code can be purchased you should have the confidence that your investment in Windows development will not lost due to events beyond your control. Besides keeping TOOLS:W simple and easy to maintain, we also built in OS2 Presentation Manager compatibility. TOOLS:PM is an identical set of tools for the OS2 Presentation Manager. Very little programming will be required to convert your application to the OS2 Presentation Manager. Therefore, you can easily maintain both a DOS version and an OS2 version of your application. In fact, data file compatibility even exists on composite networks, where one system is running Windows, and another system is running OS2. DESIGN DECISIONS We wanted to develop sophisticated MS Windows applications as quickly as possible. We also wanted to make sure that the code would be clean, easy to maintain, royalty free, and without any application design constraints. In order to accomplish this we made a number of decisions in the design and development of TOOLS:W. These decisions also help understand what TOOLS:W is, and how it works. Below are some of these decisions. SIMPLE, ELEGANT SOLUTION. We concentrated on what was needed to finish a Windows application. We stayed away from the development of CASE tools, code generators, screen painters, field definition programs, menu generators and other 4GL front end tools. While our competitors are working on trying to make their overly sophisticated development environments work, we completed TOOLS:W and are actually shipping applications developed with it. TOOLS:W, in essence, is the generic back end programming required by most applications. Instead of having a case tool or 4GL to enter program specifications, you enter specifications into user-defined-resources. Think of TOOLS:W as a 4GL without the front end. WINDOWS PROGRRAMMING THE WAY IT WAS MEANT TO BE. The Microsoft Windows SDK was developed for programmers to program in 'C'. The Windows SDK already provided easy-to-use resources and utilities for dialog boxes, icons, menus, strings, and other resources. We did not see any reason to duplicate the resources and utilities. TOOLS:W utilizes the best features of the Windows SDK while minmizing most of the difficult programming related to Windows development. SAFE DEVELOPMENT ENVIRONMENT. You can purchase the source code to TOOLS:W. Even though you will probably do few, if any, modifications to the source code, you will probably find it invaluable as a learning tool on how to develop Windows applications. And since you can purchase source code, you don't have to be overly dependent on any third party software tools developer. USE OF BTRIEVE RECORD MANAGEMENT SYSTEM. Instead of writing a data base system from scratch, we used BTRIEVE. BTRIEVE is a data base product from NOVELL that is perfect for Windows! BTRIEVE runs as a TSR API, and by September 1989 as a DLL, in a minimal amount of memory. It is fast and has many advanced features to protect your users and is also fully compatible with a OS/2 version of BTRIEVE. It is so stable that we never crashed it during the development of TOOLS:W. You will have to purchase BTRIEVE in order to use TOOLS:W, but it is royalty free upon resale of your application. FLEXIBILITY. One of the things that we have always disliked about many development utilities is the constraints that they put on application design. TOOLS:W requires that you program in 'C' using the Windows SDK. This allows you to program anything you want. TOOLS:W, itself, has few limits as to file sizes, fields, network stations or other factors besides those caused by external software and hardware limitations. FILE INITIALIZATION TOOL The File Initialization Tool provides for the definition, creation, and file initialization of BTRIEVE data files. Two functions are provided. The first function initializes global memory with file information used in opening, reading and writing to files by TOOLS:W and any other user written program. The second function can be used to create all files defined in a the TOOLS:W user defined resource for the application. STEP 1: Define database using a "User-Defined-Resource". The file below defines the two files in the TDEMO program. The Customer file has three keys, two keys have multiple key segments. The Customer Type file has one key. All of these parameters are fully described in the TOOLS:W Reference Manual. TOOLFILE 0,2,,,Customer,TDCU,124,151,512,3 TOOLKEY 0,1,5,0,1,0,0,0,0,0,0,0 TOOLKEY 0,7,5,0,1,0,0,1,0,0,0,0 TOOLKEY 0,1,5,0,1,0,0,0,0,0,0,0 TOOLKEY 0,121,3,0,1,0,0,1,0,0,0,0 TOOLKEY 0,7,5,0,1,0,0,1,0,0,0,0 TOOLKEY 0,1,5,0,1,0,0,0,0,0,0,0 TOOLFILE 1,2,,,Customer Type,TDCT,25,0,512,1 TOOLKEY 1,1,3,0,1,0,0,0,0,0,0,0 STEP2: Add the File Init Functions to your Application. By adding the function calls below to the beginning of your application, the "PmtFileInit" function will read the above user-defined-resource into global memory. This information is required by BTRIEVE to create, open, read and write to a file. If the files do not exist, the "PmtFileCreate" function will create the files. The BTRIEVE file information loaded into global memory is used by TOOLS:W and by other programming you may do. if (PMTFileInit(sResource,sPath,sDataSet)) PMTFileCreate(sResource,sPath,sDataSet); With these two simple steps your application will be able to create and use BTRIEVE data files. We kept the TOOLS:W File Initialization Tool very simple so you can get your application started very quickly. The TOOLS:W file initialization functions can be used in a more sophisticated manner by using the TOOLS:W Dialog Tool to ask for path and data set information. We actually have another development product which has already been programmed to do this and more. The TOOLS:W Start-up Tool provides source code for initial password and company id entry, file creation, entry of user information, entry of user defaults, password entry/editing and application copy protection. Although you can use TOOLS:W to program these items yourself, the purchase of the TOOLS:W Start-up Tool can save you development time and money. DIALOG TOOL The TOOLS:W Dialog Tool provides for normal (non-database) entry of information by the user. The existing Microsoft Windows Dialog Utility provided with the Windows Software Development Kit (SDK) is used to create and prototype dialog boxes. The Dialog Tool is used for initialization and detail checking of dialog input. STEP 1: Create Dialog Box using the Windows Dialog Utility. STEP 2: Add typedef 'C' structure to the include file. STEP 3: Create a "User-Defined-Resource". The user-defined-resource shown below defines the information needed by the string dialog box in the TDEMO program. Each data type (string, number, date, boolean, text, or list box) have multiple options available. TOOLDIALOG TDSTR TOOLRECORDSIZE 77 TOOLFIELD 101,1,1,Normal String,0,11,0,0,,0,0,,,,0,0,0,0,0,0 TOOLFIELD 102,1,1,Required Chars,11,11,10,0,,0,0,,,,0,0,0,0,0,0 TOOLFIELD 103,1,1,ZeroFill/Upper,22,11,0,0,,1,1,,,,0,0,0,0,0,0 TOOLFIELD 104,1,1,LegalCh,33,11,0,0,,0,0,0123456789,,0,0,0,0,0,0 TOOLFIELD 105,1,1,DefltString,44,11,0,1,deflt,0,0,,,,0,0,0,0,0,0 TOOLFIELD 106,1,1,Repeat String,66,11,0,2,,0,0,,,,0,0,0,0,0,0 STEP 4: Write 'C' function to perform dialog task. Since this dialog box does nothing other than show string input features of TOOLS:W, the function shown below does not actually do anything. However, you will normally code for some task to be done when the OK button is pressed. The lpBuf pointer points to the input data structure in the 'C' typedef above. BOOL FAR PASCAL TDemoString(hWnd,nMessage,nOption,nControl,lpBuf) HWND hWnd; unsigned nMessage,nOption,nControl; LPSTR lpBuf; { switch (nMessage) { case PMTINIT: /*Called prior to dialog creation*/ case PMTPREINPUT: /*Called before a field is input */ case PMTPOSTINPUT: /*Called after a field is input */ case PMTLBNOTIFY: /*Called upon a listbox action */ case PMTOK: /*Called when OK is pressed */ case PMTCANCEL: /*Called when CANCEL is pressed*/ } return (FALSE); } STEP 5: Call the Dialog Tool Function. PmtDialog(hWnd,sResource,fpUserFunctionName); The TOOLS:W Dialog Tool saves the programmer from doing his own complex field input validation. If you have already worked with windows you know how much time this can take trying to do it for individual dialog boxes. FILE MAINTENANCE TOOL The File Maintenance Tool provides for the addition, editing, deletion and viewing of records in a multi-user database. The TOOLS:W will make maintenance of disk based records easy. STEP 1: Create a Dialog Box using the Windows Dialog Utility. STEP 3: Create a "User-Defined-Resource". The user-defined-resource defines the information needed for customer file maintenance in the TDEMO program. The Resource file below even allows for keys in other files to be cross verified. For example, the customer file maintenance resource checks that the customer type exists in the customer type file. TOOLDIALOG TDCUST TOOLFILE 0 TOOLNOENTER TOOLFIELD 101,1,1,Cust Number,0,6,0,0,,1,1,,,,,,,,,1,0,0,5 TOOLFIELD 102,1,1,Cust Alpha,6,6,0,0,,1,0,,,,,,,,,,,, TOOLFIELD 103,1,1,Cust Name,12,31,0,0,,0,0,,,,,,,,,, TOOLFIELD 104,1,1,Cust Address,43,31,0,0,,0,0,,,,,,,,,,,, TOOLFIELD 105,1,1,Cust Address,74,31,0,0,,0,0,,,,,,,,,,,, TOOLFIELD 106,1,1,Cust Phone,105,15,0,0,,0,0,,,,,,,,,,,, TOOLFIELD 107,1,1,Cust Type,120,4,,,,1,1,,,,2,1,0,120,4,,,, TOOLFIELD 108,1,2,Type Name,4,21,0,0,,0,0,,,,1,1,,,,,,, TOOLFIELD 109,5,1,Comments,124,121,0,0,0 STEP 4: (Optional) Write 'C' function for special cases. Normally this will not be needed. However, additional input checking or actions can be taken by writing your own 'C' function similar to the 'C' function used by the Dialog Tool. In the TDEMO program we wrote a 'C' function that only allows a customer type record to be changed if the customer type is not used by any of the customer records. STEP 5: Call the Dialog Tool Function. PmtFileMaint(hWnd,nMode,sResource,fpDialogFunc) The File Maintenance Tool is called in either the ADD, EDIT, DELETE or VIEW Mode. The File Maintenance Tool can also be automatically called by the TOOLS:W Display Tool using the push buttons at the bottom of the record display screen. Since we use the Display Tool in our applications, we rarely use this function directly. DISPLAY TOOL The Display Tool provides for disk based records to be displayed in a window with a scroll bar. At the bottom of the display the buttons can be specified for calling the File Maintenance Tool, or other programmer written tasks. STEP 1: Create a "User-Defined-Resource". This resource describes the file to be displayed, what buttons will be on the bottom of the screen, and display sorts (alternate keys) that will be allowed. The Resource file below defines the TDEMO Customer Type file Display. TOOLCAPTION Customer Type File Maintenance TOOLFILE 1 TOOLOPTION Add,Add Customer Type,A,1,0,0 TOOLOPTION Edit,Edit Customer Type,E,2,0,0 TOOLOPTION Delete,Delete Customer Type,D,3,0,0 TOOLOPTION View,View Customer Type,V,4,1,0 TOOLOPTION Cancel,Cancel,C,6,0,0 TOOLHEADING Type Description TOOLKEY Type Number,0,1,0 TOOLFMRESOURCE tdctype STEP 2: Write a 'C' Display Function. This function is necessary, since it would be too difficult for us to ask for every display format. Each key sort can have its own display output and parameters passed to this function and can be used to display graphics. BOOL FAR PASCAL TDemoCTypeDYProc(nPMTAction,nOption,nSort, ,nLine,sOutBuf,lpCType,hDC,yPos,yOut) int nPMTAction,nOption,nSort,nLine; PSTR sOutBuf; LPCTYPE lpCType; HDC hDC; int yPos,yOut; { switch(nPMTAction) { case PMTDISPCREATE: break; /*Upon display creation*/ case PMTDISPDESTROY: break; /*Upon display destroyed*/ case PMTDISPBUTTON: break; /*Special Button Tasks*/ case PMTDISPPAINT: sprintf(sOut," %-3Fs %-20Fs", lpCType->sCTypeNo,lpCType->sCTypeDescript); break; } return(FALSE); } STEP 3: Call the Display Tool Function. PmtDisplay(hWnd,lpResName,fpDispFunc,fpFileMaintFunc); Your users will love the graphic orientation that the Display Tool brings to your application. REPORT TOOL The Report Tool is provided to speed up the programming of reports and lists. The steps for creating a report are listed. STEP 1: Create a Pre-Report Dialog Box. This dialog box asks for sort and range check information along with a list box for output device selection and number of copies to print. STEP 2: Create a "User Defined Resource". This user-defined-resource defines information needed by the report. The resource file below is for the TDEMO Customer Type List. TOOLDIALOG TDPCTYP TOOLRECORDSIZE 20,0 TOOLNOENTER TOOLFIELD 4,2,1,No of Copies,0,2,4,0,0,1,1,0,256,,,,,,,,,, TOOLSORT 0,1,0 TOOLOUTPUT 1,0,0,0 STEP 3: Write a 'C' Report function This 'C' function is used primily for formatting purposes. You can do what you want, or use the "PmtAutoReport" function for automatic page-headings, sub-headings, records, sub-totals and grand-totals. BOOL FAR PASCAL TDemoCTypeList(nOutput,nMessage, hPrnDC,yPos,nSort,nSub,lpCType) int nOutput,nMessage; HDC hPrnDC; int yPos,nSort,nSub; LPCTYPE *lpCType; { switch(nOutput) { case PMTDISPLAYOUTPUT: break; /*Screen Output*/ case PMTFILEOUTPUT: break; /*ASCII file output*/ case PMTSPREADOUTPUT: break; /*Delimited file output*/ case PMTPRINTEROUTPUT: /*----- Printer Output ------*/ switch(nMessage) { case PMTREPORTSTART: PmtAutoReport(nOutput,nSort,"Cust Type List"); break; case PMTREPORTPAGEHEAD: break; /*For sprintf format*/ case PMTREPORTSUBHEAD: break; /*For sprintf format*/ case PMTREPORTRECORD: break; /*For sprintf format*/ case PMTREPORTSUBTOTAL: break; /*For sprintf format*/ case PMTREPORTGRANDTOTAL: break; /*For sprintf format*/ } return(FALSE); } STEP 4: Call the Report Tool Function. PmtReport(hWnd,sResource,fpPreRepFunc,fpReportFunc); Most reports are called as menu items. Because many printers are extremely slow printing graphics, the same code will drive both normal Windows graphic printing or older style text output. HELP TOOL The Help Tool adds context sensitive Help system for your application. STEP 1: Enter Help Text into any Word Processor. An ASCII text file is generated using any word processor or text editor. Help topic header information for each help screen is at the beginning of the text for each help topic. STEP 2: Run the Help Tool Compiler. The MAKEHELP program processes the ASCII file in order to make a file usable by the TOOLS:W Help Tool. The MAKEHELP program can be added to your make program, so that any changes to the ASCII Help file will cause recompilation. STEP 3: Call the Help Tool Functions. PmtHelp(); This can be done from the menu loop so that F1 calls Help. Adding the "PmtHelpContext" function before a menu item is called will make Help context sensitive. ---------------------------------------- START-UP TOOL The Start-up Tool uses the other TOOLS:W tool to provide you with a number of start-up programs and user definable dialog boxes. The Start-up Tool provides the following modifiable programming. Start-up Dialog box asking user for password, company selection and today's date. Function that sets up files, defaults and other items using information entered into the start-up dialog box. System Menu Dialog Box for changing password, company or date. Dialog box with disk path for user creation of data files. Dialog box for entry of company information. Dialog box for entry of system defaults. File Maintenace Program for entry and editing of passwords. Allows menu items to be authorized or restricted. This programming can save you weeks, if not months of work. All of the code is well commented and easily modifiable if required DDE TOOL The DDE Tool allows applications like Microsoft Excel to access information from your database directly. STEP 1: Create a "User Defined Resource" The user-defined-resource is used to define labels for access and methods in which your database can be accessed. STEP 2: Write 'C' function for special access methods. The DDE Tool will handle many different way of gathering information from your Btrieve database. However, you can create additional methods by writing this optional 'C' function. STEP 3: Call the DDE Tool from your message loop. The DDE Tool allows you to quickly add DDE functionality to your Windows Application. ------------------------------------ VERSION TOOL The Version Tool makes making major modifications to a widely distributed application very simple. This Tool will automatically update to a new version where there have been changes to the database. The Version Tool even allows updating from multiple past versions of the application. STEP 1: Write a "User Defined Resource". The user-defined-resource is used to tell the Version Tool what files are modified from one version to another. This resource includes the record mapping from the different versions. STEP 2: Write a 'C' function for any special cases. If you add fields to a database, you may want to update the field in a special way. Each updated record is passed to this function so that you can make any changes necessary to it. STEP 3: Call the Version Tool Function. This function must be called immediately after start-up. It will check the version of the existing database. If the version is different from the current version of the software, the Version Tool will update records, create new files and perform other tasks required by the upgrade. The Version Tool can update your application from as as many past versions as needed. Therefore, you only need to worry about the latest release of your application. LICENSE AND PRICING A license to use TOOLS:W includes licensing for a single workstation. Additional licenses for the same company are available for one third of the cost of the original license. No royalites are required on the distribution of your application Base Tools(Object Only) $495 File Init Tool Dialog Tool File Maint Tool Display Tool Report Tool Help Tool Function Library Application Shell TDemo Program & Source 30 Days Support Base Tools Source Code $995 Start-up Tool(Object & Source) $295 DDE Tool(Object & Source) $295 Version Tool(Object & Source) $295 SPECIAL OFFER: Ask for a copy of one or our finished Windows applications. If you purchase a license to TOOLS:W we would like you to see how good a finished TOOLS:W application can be. This may help you with the development of your own product. We will send you one of our applications exactly like we send to our end users. This includes software, demonstration data and user manual. For more information call: THE SOFTWARE FACTORY PO Box 2639 Gainesville, Fl 32602 (904) 376-8370